<template>

  <el-dialog title="出入帐明细" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false">
  	<!--主列表数据-->
    <d2-crud
      ref="d2Crud"
      :options="mainTable.options"
      :index-row="mainTable.indexRow"
      :columns="mainTable.columns"
      :data="mainTable.list"
      :selection-row="mainTable.allowSelect"
      :loading="mainTable.loading"
      @selection-change=""
    ></d2-crud>

	  <div slot="footer" class="dialog-footer">
	    <el-button @click="close" size="small">{{ $t('page.form.close') }}</el-button>
	  </div>

  </el-dialog>
</template>

<script>

export default {
  mixins: [
  ],
  props: [
  ],
  data () {
    return {

      dialogVisible: false,
      mainTable: {
        loading: false,
        options: {
          border             : true,
          stripe             : true,
          highlightCurrentRow: true,
          emptyText          : this.$t('page-announcement.d2-crud.empty-data'),
          size               : 'mini',
        },
        indexRow: null,
        allowSelect: false,
        columns: [
          {title: '订单号', key: 'tradeNo', align: 'center', width: '180', showOverflowTooltip: true},
          {title: this.$t('page.form.accountType'), key: 'strTransType', align: 'center', showOverflowTooltip: true},
           {title: '出入帐类型', key: 'strTransType', align: 'center', showOverflowTooltip: true},
          {title: '金额', key: 'transAmount', align: 'center', showOverflowTooltip: true, formatter(row, column, cellValue, index) {
            return row.transCurrency + ' ' + row.transAmount / 100
          }},
          {title: this.$t('page.form.currency'), key: 'strHandleStatus', align: 'center', showOverflowTooltip: true},
          {title: this.$t('page.form.explain'), key: 'createBy', align: 'center', showOverflowTooltip: true},
          {title: this.$t('page.form.billingOutTime'), key: 'createTime', align: 'center', width: '150', showOverflowTooltip: true},
        ],
        list: [],
        pagination: {
          currentPage: 1,
          pageSize   : 50,
          total      : 0,
          pageSizes  : [50, 100, 200]
        },
      },

    }
  },

  methods: {

  	show (id = null) {

      this.id = id;

      this.fetchData();

      this.dialogVisible = true;
    },

    close () {
      this.dialogVisible = false;
      this.$emit('dialog-close');
    },

    fetchData () {
    	this.mainTable.loading = true;
 
    }

  }

}
</script>
